package com.scg33.inicio.calendario;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

import org.zkoss.calendar.api.DateFormatter;

import com.coreweb.util.Misc;

public class PMSDateFormatter implements DateFormatter {

	Misc m = new Misc();
	
	private String dateFormat = m.DD_MM__YYY_HORA_MIN;

	Locale locale = new Locale("es", "PY");
	
	private SimpleDateFormat normal = new SimpleDateFormat("dd MMMM", locale);
	private SimpleDateFormat semana = new SimpleDateFormat("EEEE", locale);
	private SimpleDateFormat mes = new SimpleDateFormat("dd MMM", locale);
	private SimpleDateFormat hora = new SimpleDateFormat("HH:mm", locale);

	
	

	@Override
	public String getCaptionByDate(Date date, Locale locale, TimeZone timezone) {
		return normal.format(date);
	}

	@Override
	public String getCaptionByDateOfMonth(Date date, Locale locale, TimeZone timezone) {
		return mes.format(date);
	}

	@Override
	public String getCaptionByDayOfWeek(Date date, Locale locale, TimeZone timezone) {
		return semana.format(date);
	}

	@Override
	public String getCaptionByPopup(Date date, Locale locale, TimeZone timezone) {
//		return df.format(date);
		return "popup";
	}

	@Override
	public String getCaptionByTimeOfDay(Date date, Locale locale, TimeZone timezone) {
		return hora.format(date);
	}

	@Override
	public String getCaptionByWeekOfYear(Date date, Locale locale, TimeZone timezone) {
		// return df.format(date);
		return "anio";
	}

	
	public static void main(String[] args) {
		
		PMSDateFormatter p =  new PMSDateFormatter();
		Date d = new Date();
		System.out.println(p.getCaptionByDate(d, null, null));
		System.out.println(p.getCaptionByDayOfWeek(d, null, null));
		System.out.println(p.getCaptionByDateOfMonth(d, null, null));
		System.out.println(p.getCaptionByTimeOfDay(d, null, null));
		
		
		
	}
	
}
